﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Parallel3M.parallel3m.framework
{
    public class ParallelSource:ParallelProcessor
    {
        
        public override void process()
        {
            
            ParallelPayload payload = new ParallelPayload();
            payload.id = Guid.NewGuid().ToString();
            payload.language = "csharp";
            payload.timestamp = new DateTime().Ticks;
            payload.request = "<task><function>Parallel3M.parallel3m.function.GetTextLength</function><text>computer</text></task>";
            payload.handlerid = "CSHARP_RUN";
            payload.type = PAYLOADCONSTRANT.TYPE_REQUEST;

            Console.WriteLine(name + ":" + payload.id);
            payloadcount++;

            foreach (ParallelConnection outputConnection in outputConnections)
            {                
                outputConnection.Flowin(payload);
            }

        }
    }
}
